package com.ai.service.made.impl;

import com.ai.common.CommonResponse;
import com.ai.entity.exam.ExamRecordInfoPO;
import com.ai.mapper.made.ExamRecordInfoMapper;
import com.ai.service.made.ExamRecordInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * @Author：xiaosheng
 * @Date：2024-07-02 15:41
 */
@Service
public class ExamRecordInfoServiceImpl extends ServiceImpl<ExamRecordInfoMapper, ExamRecordInfoPO> implements ExamRecordInfoService {

    @Resource
    ExamRecordInfoMapper examRecordInfoMapper;

    @Override
    public CommonResponse insert(ExamRecordInfoPO examRecordInfoPO) {
        return CommonResponse.ok(examRecordInfoMapper.insert(examRecordInfoPO));
    }

    @Override
    public List<ExamRecordInfoPO> selectByExamRecordId(Integer examRecordId) {

        QueryWrapper<ExamRecordInfoPO>queryWrapper=new QueryWrapper<>();

        queryWrapper.eq("exam_record_id", examRecordId);

        List<ExamRecordInfoPO> examRecordInfoPOList = examRecordInfoMapper.selectList(queryWrapper);

        return examRecordInfoPOList;
    }
}
